package com.qingke.easyjava.jdbc.command;

import com.qingke.easyjava.jdbcapp.pojo.Player;

public abstract class CommandFactory {

	public static enum CommandCode {
		EXIT, HELP, LOGIN, SIGNUP, ASK, ANSWER, SCORE, LIST, ACCEPT
	}

	public static CommandFactory getFactory(Player player) {
		if (player == null) {
			return new SystemCommandFactory();
		} else {
			return new PlayerCommandFactory(player);
		}
	}

	public abstract Command buildCommand(CommandCode cmdCode);

}
